<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>项目管理</title>
    <meta name="description" content="">
    <meta name="author" content="templatemo">
    <link href="../css/font-awesome.min.css" rel="stylesheet">
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/templatemo-style.css" rel="stylesheet">
    <link href="../css/admin.css" rel="stylesheet">
    <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="../js/admin.js"></script>
</head>

<body>
<?php
require_once "../congfig/config.php";
require_once "../lib/common.php";
session_start();
checkAdmin();
$id = $_GET['pid'];
$sql = "select * from proinfor where id = '$id' ";
$query = $GLOBALS['conn']->query($sql);
$result = $query->fetch_array();

?>
    <!-- Left column -->
    <div class="templatemo-flex-row">
        <div class="templatemo-sidebar">
            <header class="templatemo-site-header">
                <div class="square"></div>
                <h1>后台管理系统</h1>
            </header>
            <div class="profile-photo-container">
                <img src="../images/profile-photo.jpg" alt="Profile Photo" class="img-responsive">
            </div>
            <!-- Search box -->

            <div class="mobile-menu-icon">
                <i class="fa fa-bars"></i>
            </div>
            <nav class="templatemo-left-nav">
                <ul>
                    <li id="xmgl"><a href="project-list.php"><i class="fa fa-bars fa-fw"></i>项目管理</a>
                    <ul>
                            <li><a href="addProject.php"><i class="fa fa-bars fa-fw"></i>添加项目</a></li>
                        </ul>
                        <ul>
                            <li><a href="applyproject.php"><i class="fa fa-bars fa-fw"></i>申请立项</a></li>
                        </ul>
                        <ul>
                            <li><a href="projectsucc.php"><i class="fa fa-bars fa-fw"></i>立项成功</a></li>
                        </ul>
                        <ul>
                            <li><a href="projectfail.php"><i class="fa fa-bars fa-fw"></i>立项失败</a></li>
                        </ul>
                        <ul>
                            <li><a href="applyprojectover.php"><i class="fa fa-bars fa-fw"></i>申请结项</a></li>
                        </ul>
                        <ul>
                            <li><a href="projectok.php"><i class="fa fa-bars fa-fw"></i>结项成功</a></li>
                        </ul>
                        <ul>
                            <li><a href="projectnok.php"><i class="fa fa-bars fa-fw"></i>结项失败</a></li>
                        </ul>
                        <ul>
                            <li><a href="goodpro.php"><i class="fa fa-bars fa-fw"></i>优秀项目</a></li>
                        </ul>
                    </li>
                    <li id="yhgl"><a href="user-list.php"><i class="fa fa-user fa-fw"></i>用户管理</a>
                        <ul>
                            <li><a href="addUser.php"><i class="fa fa-user fa-fw"></i>添加用户</a></li>
                        </ul>
                    </li>
                    <li><a href="pad-check.php"><i class="fa fa-cog fa-fw"></i>修改密码</a></li>
                    <li><a href="../loginout.php" id="zx"><i class="fa fa-map-marker fa-fw"></i>注销</a></li>
                </ul>
            </nav>
        </div>
        <!-- Main content -->
        <div class="templatemo-content col-1 light-gray-bg" style="height:1000px;">
            <div class="container" style="margin-top:100px;">
                <a style="font-size:18px; color:rgb(19,137,95);" href="project-list.php"><i class="fa fa-arrow-circle-left fa-fw"></i>
                    返 回</a>
            </div>
            <div style="text-align: right;width: 100%;">
                <form class="form-horizontal" id="editpro" enctype="multipart/form-data">
                    <div class="form-group">
                        <label class="col-xs-4 control-label">项目名称</label>
                        <div class="col-xs-5">
                            <input type="hidden" name="pid" id="pid" value="<?php echo $id ?>" />
                            <input type="text"   value="<?php echo $result['pName'] ?>" class="form-control input-sm" style="margin-top: 7px;" readonly>
                        </div>
                    </div>
                    <?php
                    $username = $result["pChar"];
                    $sql1 = "select * from userinfor where uid =(select uid from users where username='$username')";
                    $query1 = $conn->query($sql1);
                    $result1 = $query1->fetch_array();
                    $username1 = $result["teacher"];
                    $sql2 = "select * from userinfor where uid =(select uid from users where username='$username1')";
                    $query2 = $conn->query($sql2);
                    $result2 = $query2->fetch_array();
                    ?>
                    <div class="form-group">
                        <label class="col-xs-4 control-label">项目负责人</label>
                        <div class="col-xs-5">
                            <input type="text" name="pChar" id="pChar" value="<?php echo $result1['realname'] ?>" class="form-control input-sm" style="margin-top: 7px;" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-4 control-label">指导教师</label>
                        <div class="col-xs-5">
                            <input type="text" name="teacher" id="teacher" value="<?php echo $result2['realname'] ?>" class="form-control input-sm" style="margin-top: 7px;" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-4 control-label">项目简介</label>
                        <div class="col-xs-5">
                            <textarea type="text" name="pDesc" id="pDesc"  class="form-control input-sm" style="margin-top: 7px;height: 300px;"readonly><?php echo $result['pDesc'] ?> </textarea>
                        </div>
                    </div>
                    <div class="form-group">
                                    <!-- <label  class="col-xs-4 control-label">项目进度</label>
                                        <select name ="pRank" id="pRank" required class="col-xs-5" style="margin-left:15px;">
                                                <option  value ="0" selected>设计</option>
                                                <option  value ="1"> 数据库设计</option>
                                                <option  value ="2"> Web开发； </option>
                                                <option  value ="3"> 准备结题答辩。</option>
                                        </select> -->
                            
                    </div>
                    <!-- <div class="form-group">
                        <label class="col-xs-4 control-label">文件上传</label>
                        <div class="col-xs-5">
                            <input type="file" name="Enclosure" id = "Enclosure"style="margin-top: 7px;" />
                        </div>
                    </div> -->
                    
                </form>
                <div class="col-xs-offset-4 col-xs-5" style="margin-left: 150px;margin-top: 20px;">
                <input type="button" class="btn btn-xs btn-success" id="addProjectUser-bc" value="
                <?php
                switch ($result['pRank']) {
                    case 0:
                        echo "申请立项";
                        break;
                    case 1:
                        echo "立项成功";
                        break;
                    case 2:
                        echo "立项失败";
                        break;
                    case 3:
                        echo "申请结项";
                        break;
                    case 4:
                        echo "结项成功";
                        break;
                    case 5:
                        echo "结项失败";
                        break;
                    case 6:
                        echo "逾期项目";
                        break;
                }
                ?>
                " >
                </div>
            </div>
        </div>
    </div>
    </div>
</body>

</html>